package kr.re.etri.snsenabler.shared;

public enum SocialServiceProvider {
	// @formatter:off
	DaumBlog("daum_blog", "Daum Blog", 1),
	DaumCafe("daum_cafe", "Daum Cafe", 1),
	Naver("naver", "Naver", 1),
	Twitter("twitter", "Tweeter", 1),
	Facebook("facebook", "facebook", 2);
	// @formatter:on

	String name;
	String title;
	int oAuthVersion;

	private SocialServiceProvider(String name, String title, int oAuthVersion) {
		this.name = name;
		this.title = title;
		this.oAuthVersion = oAuthVersion;
	}

	public String getName() {
		return name;
	}

	public String getTitle() {
		return title;
	}

	public int getoAuthVersion() {
		return oAuthVersion;
	}

	public static SocialServiceProvider fromName(String name) {
		for (int i = 0; i < values().length; i++) {
			if (values()[i].name.equals(name)) {
				return values()[i];
			}
		}
		return null;
	}
}
